using System;
using System.Collections.Generic;
using System.Text;

namespace mobiledata
{
    public class MobileDataManager
    {
        /// <summary>
        /// 
        /// </summary>
        public static MobileDataManager instance = new MobileDataManager();

        /// <summary>
        /// 
        /// </summary>
        MobileDataManagerImpl myImpl = MobileDataFactory.instance.createDBAdapter();

        /// <summary>
        /// 
        /// </summary>
        MobileDataManager()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dbConnStr"></param>
        /// <param name="dbKind"></param>
        public static void init(String dbConnStr, DatabaseKind dbKind)
        {
            MobileDataFactory.init(dbConnStr, dbKind);
        }
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="firstName"></param>
        /// <param name="lastName"></param>
        public void createUser(String firstName, String lastName)
        {
            myImpl.createUser(firstName, lastName);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public User getUser(long userId)
        {
            return myImpl.getUser(userId);
        }

        public User getUser(String username, String password)
        {
            return myImpl.getUser(username, password);
        }

    }
}
